Skip to content

fix(@angular/build): pass process environment variables to prerender workers#32732

Open
alan-agius4 wants to merge 1 commit intoangular:20.3.xfrom
alan-agius4:prerender-env-20
Open

fix(@angular/build): pass process environment variables to prerender workers#32732
alan-agius4 wants to merge 1 commit intoangular:20.3.xfrom
alan-agius4:prerender-env-20

Conversation

@alan-agius4
Copy link
Collaborator

Worker processes used for prerendering and route extraction now inherit process.env. This ensures that any custom environment variables required by the application are available during the server-side rendering process.

Closes #32730

@alan-agius4 alan-agius4 added the target: lts This PR is targeting a version currently in long-term support label Mar 10, 2026
@alan-agius4 alan-agius4 requested a review from clydin March 10, 2026 11:17
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 10, 2026
@alan-agius4 alan-agius4 linked an issue Mar 10, 2026 that may be closed by this pull request
1 task
@alan-agius4 alan-agius4 changed the title fix(angular/build): pass process environment variables to prerender workers fix(@angular/build): pass process environment variables to prerender workers Mar 10, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to pass process environment variables to prerender and route extraction workers. The implementation correctly uses the spread syntax to include process.env. However, there's a potential issue with how NG_ALLOWED_HOSTS is handled. If a user has this variable set in their environment, it will overwrite the default 'localhost' value, which can break the prerendering process as it needs to access localhost. I've suggested a fix to merge the user-provided hosts with localhost to prevent this issue, ensuring both user configuration and prerendering functionality are preserved.

…workers

Worker processes used for prerendering and route extraction now inherit `process.env`. This ensures that any custom environment variables required
by the application are available during the server-side rendering process.

Closes angular#32730
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 10, 2026
@alan-agius4 alan-agius4 removed the request for review from clydin March 10, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strict host header validation breaks route extraction

2 participants